package com.itheima.neibulei2;

public class Test {

    public static void main(String[] args) {
    //成员内部类的使用
        Outer outer = new Outer();
        System.out.println(outer.a);
        outer.sing();
        // 外部类名.内部类名 对象名= new 外部类名().new 内部类名();
        //Outer.Inner inner = new Outer().new Inner();
        Outer.Inner inner = outer.new Inner();
        System.out.println(inner.b);
        inner.dance();
    }
}

class Outer {
    int a = 10;

    class Inner {
        int b = 20;

        public void dance() {
            System.out.println("inner...dance");
        }
    }

    public void sing() {
        System.out.println("outer...sing");
    }

}